`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    16:39:33 03/27/2014 
// Design Name: 
// Module Name:    position_generation 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module position_generation_rev1(	clk,
										new_enemy_1,//enemy1 generation signal
										new_enemy_2,//enemy2 generation signal
										new_bullet_1,
										cha_pos_x,//character position signal
										cha_pos_y,
										position_x_1,
										position_y_1,
										position_x_2,
										position_y_2,
										position_bullet_x,
										position_bullet_y,
										position_valid_1, //if enemy is in the right range
										position_valid_2, //if enemy is in the right range
										position_valid_3);//if bullet is in the right range

input clk,new_enemy_1,new_enemy_2,new_bullet_1;
input [9:0] cha_pos_x,cha_pos_y;
output [9:0] position_x_1,position_y_1,position_x_2,position_y_2,position_bullet_x,position_bullet_y;
output position_valid_1, position_valid_2,position_valid_3;

wire [15:0] rand;

rand random_generation(		.clk(clk),
							.rand(rand));

enemy_AI_ripple enemy_1(	.clk(clk),
                            .rand(rand),
                            .new_enemy(new_enemy_1),
                            .position_x(position_x_1),
                            .position_y(position_y_1),
                            .position_valid(position_valid_1));


enemy_AI_track_cha enemy_2(	.clk(clk),
                            .rand(rand),
                            .new_enemy(new_enemy_2),
                            .cha_pos_x(cha_pos_x),
                            .cha_pos_y(cha_pos_y),
                            .position_x(position_x_2),
                            .position_y(position_y_2),
                            .position_valid(position_valid_2));
										
enemy_bullet bullet_1( 	.clk(clk),
                        .rand(rand),
                        .new_bullet(new_bullet_1), 
                        .enemy_pos_x(position_x_1), 
                        .enemy_pos_y(position_y_1),
                        .position_x(position_bullet_x), 
                        .position_y(position_bullet_y),
                        .position_valid(position_valid_3));

endmodule
